package com.yc.jpyy.base.config;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 获取config.properties配置文件的地址
 */
public class Config {
	private static Properties prop = null;
	static final Logger logger = LoggerFactory.getLogger(Config.class);
	/**
	 * load config
	 **/
	static {
		loadProp();
	}

	/**
	 * load the config into cache
	 **/
	public static void loadProp() {
		try {
			prop = new Properties();
			prop.load(Config.class.getClassLoader().getResourceAsStream(
					"config.properties"));
		} catch (IOException e) {
			logger.info("load config failed:" + e.getMessage());
		}
	}

	/**
	 * 获取基础信息图片地址
	 **/
	public static String getImageAddress() {
		return prop.getProperty("image.address", "");
	}
	
	/**
	 * 获取txt/jpg文件URL
	 **/
	public static String getDriverInfoURL() {
		return prop.getProperty("driverInfo.Url", "");
	}
}
